package cn.zhaoguang.usedcar.common.exception;

import cn.zhaoguang.usedcar.common.http.ResultVO;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @Description 自定义异常处理类
 * @Author zhaoguang
 * @Date 2021/3/15 1:11
 */
@RestControllerAdvice
public class CustomExceptionHandler {

    @ExceptionHandler(AuthorizationException.class)
    public ResultVO handleTokenAuthorizationException(AuthorizationException e) {
        return ResultVO.error(e.getMessage());
    }
}
